[#include "/common/mainTemplate.ftl"]
[@main title="表格使用 Demo"]

<div>
	<table class="table table-striped table-hover">
		<thead>
			<tr>
				<th>名称</th>
				<th>年龄</th>
				<th>邮箱</th>
				<th>手机号</th>
				<th>操作</th>
			</thead>
			<tbody>
	    [#if array??]
		    [#list array as sub]
				<tr>
					<td>${sub.userName!}</td>
					<td>${sub.age!}</td>
					<td>${sub.mail!}</td>
					<td>${sub.phone!}</td>
					<td><button class="btn btn-small btn-primary" type="button" onclick="editContent(${sub.id})">查看</button></td>
				</tr>
			[/#list]
	    [/#if]
	    </tbody>
	</table>
</div>

[@common.page actionUrl="../login/findlist"/]

<form id="edit" action="edit" method="Post">
	<input name="userId" id="userId" type="hidden" value=""/>
</form>

<script type="text/javascript">
function editContent(id) {
	document.getElementById("userId").value = id;
	document.getElementById("edit").submit();
}
</script>
[/@main]